package cn.concurrence.cas;

import java.util.concurrent.atomic.AtomicInteger;

/**
 * @author summit
 * @since 2022/4/20 11:04
 */
public class AutomicTest {


	public static void main(String[] args) {
		AtomicInteger integer = new AtomicInteger(100);

		System.out.println(integer.compareAndSet(100, 200) + "___cas后值为" + integer.get());

		System.out.println(integer.compareAndSet(100, 300) + "___cas后值为" + integer.get());

	}
	/**
	 * true___cas后值为200
	 * false___cas后值为200
	 */
}
